/*
 * acm1338.c
 *
 *  Created on: 24 Mar 2010
 *      Author: xuxu
 */

#include<stdio.h>
int main()
{
	int down,up,downcount,upcount;
	int state,kept,boup,bodown;
	int data,olddata;
	int n;
	n=1;
	while(scanf("%d",&data)&&!(data==0&&n==1))
	{
		down=0;
		up=0;
		state=0;
		kept=1;
		olddata=data;
		downcount=1;
		upcount=1;
		n=1;
		boup=bodown=0;
		while(scanf("%d",&data)&&data)
		{
			n++;
			if(data>olddata)
			{
				if(0==state)
				{
					up+=kept;
					boup=1;
				}
				else if(1==state)
					up++;
				else
				{
					up++;
					if(!boup)
						boup=1;
					else
						upcount++;
				}
				state=1;
			}
			else if(data<olddata)
			{
				if(0==state)
				{
					down+=kept;
					bodown=1;
				}
				else if(2==state)
					down++;
				else
				{
					down++;
					if(!bodown)
						bodown=1;
					else
						downcount++;
				}
				state=2;
			}
			else
			{
				if(1==state)
				{
					up++;
				}
				else if(2==state)
				{
					down++;
				}
				else
				{
					kept++;
				}
			}
			olddata=data;
		}
		printf("Nr values = %d:  %.6lf %.6lf\n",n,(double)up/(double)upcount,(double)down/(double)downcount);
		n=1;
	}
	return 0;
}
